<?php

namespace app\controller;
// 注册

use app\Request;
use app\service\RegisterService;
use app\util\Utils;

class Register extends Base
{
    private $registerService;
    public function __construct()
    {
        $this->registerService = new RegisterService();
    }

    public function register(Request $request){
        $req = $request->post();
        $phone = $req['phone'];
        if (Utils::isPoneLandline($phone)){
            $rut =$this->registerService->Register($req);
            return $this->Success($rut);
        }else{
            return $this->Error('手机格式有问题');
        }

    }
}